package org.toonWatch


class Cart {

    static belongsToOne = [user: User]

//    int id
    Double amount
    Date paymentDate
    Voucher voucher

    static constraints = {
//        id(nullable:false, unique:true, generate: 'assigned', matches: '[0-9]{8}') //primary key
        amount(nullable:false , blank:false)
        paymentDate(nullable:false,blank:false)
//        voucher(nullable:true) //each shopping may or may not be entitled to a voucher
    }

    static hasMany = [transactions : Transaction]

    static mapping = {
        voucher lazy:false
    }
}
